package com.terabits.smartriver.controller;

import com.terabits.smartriver.constants.result.BaseResp;
import com.terabits.smartriver.constants.result.ResultStatus;
import com.terabits.smartriver.service.AlarmService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Yin on 2019/3/1
 * 告警管理接口
 */
@CrossOrigin
@RestController
public class AlarmController extends BaseController {
    @Autowired
    private AlarmService alarmService;

    @ApiOperation(value = "警告 查询", tags = {"告警管理"})
    @RequestMapping(value = "alarm-mgt/alarm/get", method = RequestMethod.GET)
    public BaseResp getAlarm() {
        return new BaseResp(ResultStatus.SUCCESS, alarmService.getAlarm(this.getPageData()));
    }


    @ApiOperation(value = "查询检修记录", tags = {"检修记录"})
    @RequestMapping(value = "alarm-mgt/alarm/maintain/get", method = RequestMethod.GET)
    public BaseResp getMaintain() {
        return new BaseResp(ResultStatus.SUCCESS, alarmService.getMaintain(this.getPageData()));
    }

}